//
//  BKXEmotionPageViewCell.swift
//  微博
//
//  Created by 田凯 on 16/4/25.
//  Copyright © 2016年 田凯. All rights reserved.
//

import UIKit

class BKXEmotionPageViewCell: UICollectionViewCell {
    
    // indexPath 属性
    var indexPath: NSIndexPath?{
        didSet{
            showLabel.text = "第\(indexPath!.section)组 第\(indexPath!.item)个Cell\n 从0 开始"
            
        }
    
    }
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
 
    // 设置视图UI
    func setupUI(){
    self.backgroundColor = RandomColor()
        // 添加显示label
        contentView.addSubview(showLabel)
        //添加约束
        showLabel.snp_makeConstraints { (make) -> Void in
            make.center.equalTo(self)
        }
        
        
    
    }
    // MARK: - 懒加载显示第几组 第几个cell的label
    private lazy var showLabel: UILabel = {
        let lab = UILabel ()
        lab.font = UIFont.systemFontOfSize(35)
        lab.textColor = UIColor.redColor()
        lab.numberOfLines = 2
        lab.textAlignment = .Center
        
        lab.sizeToFit()
        return lab
        
        }()
    
    
}
